<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
$(function(){
	$('#applyResult').empty();
});

function applyPage(){
	$('#applyResult').empty();
	$.post('code/apply.json?localFile=${localFile}', function(data){
		if(data && data.code == 0){
			$('#applyResult').html('应用完毕，请刷新页面后在&nbsp;<strong>测试表</strong>&nbsp;菜单里查看效果');
		}else{
			$('#applyResult').text('应用失败:' + data.error);
		}
	});	
}
</script>
<h2>步骤3：下载生成的管理画面</h2>
<ul>
<li>请提前把自动生成的域对象提前拷贝到相应目录下，管理页面才能正确运行</li>
</ul>
<table>
	<tr>
		<td><strong>WEB-INF/views/tabs/${page}</strong></td>
		<td>
			<a target="_blank" href="${preview}">查看</a>
		</td>
		<td>
			<a target="_blank" href="${download}">下载</a>
		</td>
		<td>
			<a href="#" onclick="applyPage();">应用</a>
		</td>
	</tr>
<c:if test="${overrided}">
	<tr>
		<td><strong>com/joinway/admin/service/${code}</strong></td>
		<td>
			<a target="_blank" href="${codePreview}">查看</a>
		</td>
		<td>
			<a target="_blank" href="${codeDownload}">下载</a>
		</td>
		<td></td>
	</tr>
</c:if>
</table>
<table>
	<tr>
		<td><strong>保存位置</strong></td>
		<td>${path}</td>
	</tr>
<%-- 	<tr>
		<td><a target="_blank" href="${file}">预览</a></td>
	</tr> --%>
</table>
<p id="applyResult"></p>